/*
 * @Author: yayalee yangcheng960813@163.com
 * @Date: 2023-10-31 19:44:05
 * @LastEditTime: 2023-11-03 20:38:25
 * @LastEditors: yayalee yangcheng960813@163.com
 * @Description: 
 * @FilePath: \double-11-war\assets\script\Main.ts
 * 可以输入预定的版权声明、个性签名、空行等
 */
import { _decorator, Component, JsonAsset, Node, UITransform } from 'cc';
import _layer from '../cocos-libs/_cmpt/_layer';
import { AbName, DialogName } from './default/Default';
import { user } from './data/UserInfo';
import _res from '../cocos-libs/_cmpt/_res';
import messageCfg from './data/MessageConfig';
import shopCfg from './data/ShopConfig';
import _random from '../cocos-libs/_/_random';
const { ccclass, property } = _decorator;

@ccclass('Main')
export class Main extends Component {

    async onLoad() {
        console.error("种子：", _random.seed);
        _layer.inst.showLoading();
        const [message, shop] = await _res.loadAssetAny({
            requests: [
                { path: `${AbName.config}message`, type: JsonAsset },
                { path: `${AbName.config}shop`, type: JsonAsset }
            ]
        }) as JsonAsset[];
        messageCfg.init(message.json!);
        shopCfg.init(shop.json!);
        user.init();
        await _layer.inst.enterMain({ path: DialogName.homeDialog });
        _layer.inst.hideLoading();
    }

}

